Week 2
June 15, 2023
- Port forwarding from remote machine
ssh -N -f -L localhost:YYYY:localhost:XXXX remoteuser@remotehost
June 13, 2023
Meeting with Deven / Sudhir
Methods for writing data to SQLite DBs:
- Django
- Directly with
pandasto_SQL(U and D are difficult)- Requires a
SQLAlchemyengine orSQLite3connection
- Requires a
- Using raw SQL queries through a
SQLite3connection (using python SQLite library)- For a code example, look at the
cctv_appsproject
- For a code example, look at the
We decided to go with pandas to_SQL method and we union the columns of the different csv files into tables named after video_group (e.g. 05052020_frames where 05052020 is the video_group name)
June 12, 2023
Meeting with Sudhir/Deven
- For
gqc-utils-pythonrepo, we stick to working on the main branch and only make necessary changes incolabbranch.
June 09, 2023
Test design for identifying distance gaps and comparing with results based on single frame OCR
Goal of this test is to,
- Obtain the frames having blank distance values assigned (
gap frames)- Rerun those frames through a modified OCR pipeline where individual frames will be sent to Azure.
- Compare the extracted (and filtered) distance output from the new method with the result in 1.
Design
note
Update: 06/09/2023 After reviewing some of the output, Sudhir decided NOT to move forward with this experiment and use the stitched frames based OCR method as before on the pipeline.
note
- At the moment, we have the OCR results from the stitched frames based method. Will be defining the design based on the next steps required.
- This experiment will be done on a single
video-group
- Obtain the distance gaps and a list of corresponding frames
- Separate the
label extractionnotebook todistance extractionanddefect extractionnotebooks. We will only be focusing ondistance extractionin the following steps. -
Update thelabel extractionnotebook to work with the newvideo-typesidentified during streamlit apps based classification process. (We can make a modification in the notebook to bypass that for this experiment. But I'll go ahead and implement it anyway as it is needed to identify the defect codes) - Extract distances using
label extractionnotebook. - Create and run a notebook to find
frame-ids from the set of output csv files fromlabel extractionoutput for rows having blank distance values. Let's call the output list asgap frame listand will be saved asExperiments/Gap_Frame_Lists/<video_group>.csv. - Modify the
distance post processingnotebook to generate and save plots,distancevs.frame index, for each video for both the output from thelabel extractionand output after post processing. Also it should create adistance_extraction_statisticscsv file which containsvideo_id,gap frame countandtotal frame count. Post processing notebook generates the filtered output (anomalies removed and gaps filled with interpolation/extrapolation).- Statistics - gap frames, total frames across all videos
- Plots - no plots
- Separate the
- Rerun the
gap framesthrough Azure OCR on a per frame basis.- Make sure to use Barbara's Azure API keys.
- Create a modified version of current Azure OCR notebook in MSI machine (
/home/gqc/git/gqc/gqc-utility-notebooks/nbs/cctv/colab-cctv-full-frame-stitch-and-Azure-OCR.ipynb) to skip the image stitching part and read the corresponding frames fromgap frame listinstead of all frames of thevideo-group. The outputJSONfiles will be written toExperiments/Gap_Frame_JSON/<video_group>/folder. - Create a notebook to update the existing OCR results with the new JSON files obtained in the previous step which should do the following,
- extract the
JSON zipfiles containing the results from stitched frames based OCR intoExperiments/Temp/<video_group>/folder. - Overwrite the
JSONfiles in this folder from theJSONfiles fromExperiments/Gap_Frame_JSON/<video_group>/ - Create zip of the overwritten
JSONfolder and place it asExperiments/Enhanced_JSON/JSON_<video_group>.zip
- extract the
- Generate the results and compare the outputs.
- Create a backup of the label extraction and distance filtering outputs which used the results from stitched frames based Azure OCR.
- Rerun the
label extractionnotebook with theAzure JSON ZIPpath set toExperiments/Enhanced_JSON/JSON_<video_group>.zip. - Create a backup of the plots and
distance_extraction_statisticsgenerated usingdistance post processingnotebook version created in1.4, and rerun it on the new data to generate the filtered output and the corresponding plots+statistics. - Compare the resultant plots and the
distance_extraction_statisticscsv files from the two runs.